/**
 * 
 */
package org.gov.vis.data.gui;

import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.util.ResourceBundle;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;

import org.gov.vis.data.gui.listener.ViewDistributionSemenListener;
import org.gov.vis.gui.VisBaseDialog;
import org.gov.vis.gui.util.GuiUtil;
import org.gov.vis.util.Util;

/**
 * @author user
 *
 */
public class ViewDistributionSemenDialog extends VisBaseDialog{

	/**
	 * 
	 */
	private static final long serialVersionUID = 3037592139958515222L;
	
	private JPanel viewDistributionSemenPanel;
	private JPanel searchPnl;
	private JLabel codeLbl;
	private JTextField codeTxtBx;
	private JButton searchBtn;
	private JPanel outerSrchPnl;
	private JScrollPane scrlPnDistributionSemenResults;
	private JPanel pnlDistributionSemenResults;
	
	final private ResourceBundle rb = Util.getResources();

	public ViewDistributionSemenDialog(Frame owner, String title, boolean modal) {
		super(owner, title, modal);
		initGUI();
		GuiUtil.CompCenterCords cords=GuiUtil.getCompCenterCords(700, 500);
		setBounds(cords.getX(), cords.getY(), 700, 500);	
		this.setSize(700,500);
	}

	public JPanel getPnlDistributionSemenResults() {
		return pnlDistributionSemenResults;
	}

	private void initGUI() {
		try {
			{
			
				GridBagLayout thisLayout = new GridBagLayout();
				thisLayout.rowWeights = new double[] {0.1};
				thisLayout.rowHeights = new int[] {7};
				thisLayout.columnWeights = new double[] {0.1};
				thisLayout.columnWidths = new int[] {7};
				getContentPane().setLayout(thisLayout);
				this.setSize(700, 500);
			}
			{
			viewDistributionSemenPanel = new JPanel();
			GridBagLayout viewDistributionSemenMainPnlLayout = new GridBagLayout();
			getContentPane().add(viewDistributionSemenPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
			viewDistributionSemenMainPnlLayout.rowWeights = new double[] {0.0, 0.0, 0.0, 0.1, 0.0};
			viewDistributionSemenMainPnlLayout.rowHeights = new int[] {7, 7, 7, 7, 7};
			viewDistributionSemenMainPnlLayout.columnWeights = new double[] {0.0, 0.1, 0.0};
			viewDistributionSemenMainPnlLayout.columnWidths = new int[] {7, 7, 7};
			viewDistributionSemenPanel.setLayout(viewDistributionSemenMainPnlLayout);
			
			{
				{
					searchPnl = new JPanel();
					GridBagLayout searchPnlLayout = new GridBagLayout();
					searchPnlLayout.rowWeights = new double[] {0.0, 0.1, 0.0};
					searchPnlLayout.rowHeights = new int[] {7, 7, 7};
					searchPnlLayout.columnWeights = new double[] {0.0, 0.0, 0.0, 0.1, 0.0, 0.1, 0.0};
					searchPnlLayout.columnWidths = new int[] {20, 7, 7, 7, 20, 20, 7};
					searchPnl.setLayout(searchPnlLayout);
					viewDistributionSemenPanel.add(getSearchPnl(), new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
					searchPnl.setBorder(BorderFactory.createTitledBorder("Search Distribution Semen"));
					{
						codeLbl = new JLabel();
						searchPnl.add(codeLbl, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
						codeLbl.setText(setFieldLabel(getResources().getString("dialog_label_ai_code"), false));
					}
					{
						codeTxtBx = new JTextField();
						searchPnl.add(codeTxtBx, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
					}
					{
						searchBtn = new JButton();
						searchPnl.add(searchBtn, new GridBagConstraints(5, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
						searchBtn.setText(rb.getString("dialog_button_serach"));
						searchBtn.addActionListener(new ViewDistributionSemenListener(this));
					}
				}
			}
			
			{
				outerSrchPnl = new JPanel();
				GridBagLayout outerSrchPnlLayout = new GridBagLayout();
				viewDistributionSemenPanel.add(outerSrchPnl, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
				outerSrchPnlLayout.rowWeights = new double[] {0.1, 0.0};
				outerSrchPnlLayout.rowHeights = new int[] {7, 7};
				outerSrchPnlLayout.columnWeights = new double[] {0.0, 0.1, 0.0};
				outerSrchPnlLayout.columnWidths = new int[] {7, 7, 7};
				outerSrchPnl.setLayout(outerSrchPnlLayout);
				outerSrchPnl.setBorder(BorderFactory.createTitledBorder("Search Results"));
				{
					scrlPnDistributionSemenResults = new JScrollPane();
					outerSrchPnl.add(scrlPnDistributionSemenResults, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
					{
						pnlDistributionSemenResults = new JPanel();
						scrlPnDistributionSemenResults.setViewportView(pnlDistributionSemenResults);
						//scrlPnGopMitSrcResults.setBorder(BorderFactory.createTitledBorder("Scroll Pane Results"));
						GridBagLayout pnlGopMitSrchResultsLayout = new GridBagLayout();
						pnlGopMitSrchResultsLayout.rowWeights = new double[] {0.0, 0.1};
						pnlGopMitSrchResultsLayout.rowHeights = new int[] {7, 20};
						pnlGopMitSrchResultsLayout.columnWeights = new double[] {0.1};
						pnlGopMitSrchResultsLayout.columnWidths = new int[] {7};
						pnlDistributionSemenResults.setLayout(pnlGopMitSrchResultsLayout);
					}
				}
			}
			
			
			}
			
			
			
		} catch(Exception e) {
			e.printStackTrace();
		}
	}

	public JPanel getSearchPnl() {
		return searchPnl;
	}

	public JLabel getCodeLbl() {
		return codeLbl;
	}

	public JTextField getCodeTxtBx() {
		return codeTxtBx;
	}

	public JButton getSearchBtn() {
		return searchBtn;
	}

	public void setSearchPnl(JPanel searchPnl) {
		this.searchPnl = searchPnl;
	}

	public JPanel getViewDistributionSemenPanel() {
		return viewDistributionSemenPanel;
	}





}
